// Copyright (C) 2016 All rights reserved.
// Author: liufeng11@letv.com (Liu Feng)
// Description:
#ifndef _FONTFEATUREEXTRACTOR_H
#define _FONTFEATUREEXTRACTOR_H

#include <vector>


#define SETROWS 30
#define SETCOLS 30
// Actual size may be greater than size setted
#define ROWS 32 
#define COLS 32 


class FontFeatureExtractor {
public:
  bool GetFeature(unsigned int charCode, std::vector<double>* feature);
  virtual ~FontFeatureExtractor(){};
  std::vector<double> operator()(unsigned int charCode);
protected:
  // Maybe you need to override this function
  virtual void ExtractFeature(const unsigned char* data, std::vector<double>* feature);

  void Normalize(std::vector<double> *v);
  void Transpose(const unsigned char* ch, unsigned char* r, int rows, int cols);
  bool GetData(unsigned int charCode, unsigned char* data);
  void Show(const unsigned char* ch, int rows, int cols);
};
#endif //FONTFEATUREEXTRACTOR_H
